<h3 class="page-heading">CloudWatch 详情</h3>

<div class="gf-form-group max-width-30">
  <div class="gf-form gf-form-select-wrapper">
    <label class="gf-form-label width-13">身份验证提供商</label>
    <select class="gf-form-input gf-max-width-13" ng-model="ctrl.current.jsonData.authType" ng-options="f.value as f.name for f in ctrl.authTypes"></select>
  </div>

  <div class="gf-form" ng-show='ctrl.current.jsonData.authType == "credentials"'>
    <label class="gf-form-label width-13">凭据配置文件名称</label>
    <input type="text" class="gf-form-input max-width-18" ng-model='ctrl.current.database' placeholder="默认"></input>
    <info-popover mode="right-absolute">
      凭据配置文件名称，在 ~/.aws/credentials 中指定，默认为空
    </info-popover>
  </div>

  <div class="gf-form" ng-show='ctrl.current.jsonData.authType == "keys"'>
    <label class="gf-form-label width-13">访问密钥 ID </label>
    <label class="gf-form-label width-13" ng-show="ctrl.accessKeyExist">配置的</label>
    <a class="btn btn-secondary gf-form-btn" type="submit" ng-click="ctrl.resetAccessKey()" ng-show="ctrl.accessKeyExist">重置</a>
    <input type="text" class="gf-form-input max-width-18" ng-hide="ctrl.accessKeyExist" ng-model='ctrl.current.secureJsonData.accessKey'></input>
  </div>

  <div class="gf-form" ng-show='ctrl.current.jsonData.authType == "keys"'>
    <label class="gf-form-label width-13">秘密访问密钥</label>
    <label class="gf-form-label width-13" ng-show="ctrl.secretKeyExist">配置的</label>
    <a class="btn btn-secondary gf-form-btn" type="submit" ng-click="ctrl.resetSecretKey()" ng-show="ctrl.secretKeyExist">重置</a>
    <input type="text" class="gf-form-input max-width-18" ng-hide="ctrl.secretKeyExist" ng-model='ctrl.current.secureJsonData.secretKey'></input>
  </div>

  <div class="gf-form" ng-show='ctrl.current.jsonData.authType == "arn"'>
    <label class="gf-form-label width-13">Assume Role ARN</label>
    <input type="text" class="gf-form-input max-width-18" ng-model='ctrl.current.jsonData.assumeRoleArn' placeholder="arn:aws:iam:*"></input>
    <info-popover mode="right-absolute">
      ARN of Assume Role
    </info-popover>
  </div>

  <div class="gf-form">
    <label class="gf-form-label width-13">默认区域</label>
    <div class="gf-form-select-wrapper max-width-18 gf-form-select-wrapper--has-help-icon">
      <select class="gf-form-input" ng-model="ctrl.current.jsonData.defaultRegion" ng-options="region for region in ['ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'ap-south-1', 'ca-central-1', 'cn-north-1', 'cn-northwest-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'sa-east-1', 'us-east-1', 'us-east-2', 'us-gov-west-1', 'us-west-1', 'us-west-2']"></select>
      <info-popover mode="right-absolute">
        自定义指标的命名空间
      </info-popover>
    </div>
  </div>
  <div class="gf-form">
    <label class="gf-form-label width-13">自定义指标</label>
    <input type="text" class="gf-form-input max-width-18" ng-model='ctrl.current.jsonData.customMetricsNamespaces' placeholder="命名空间1,命名空间2"></input>
    <info-popover mode="right-absolute">
      自定义指标的命名空间
    </info-popover>
  </div>
</div>
